'use strict';  
const nodemailer = require('nodemailer') // 记得在当前文件夹执行npm install nodemailer后才能使用  
exports.main = async (event, context) => {  
    let transporter = nodemailer.createTransport({  
        host: 'smtp.exmail.qq.com',  
        secureConnection: true,  
        port: 465,  
        secure: true,  
        auth: {  
            user: '1149751368@qq.com',  
            pass: 'vjcwimdgluqbjcbi'  
        }  
    })  
    const info = await transporter.sendMail({  
        from: '"童雅丽"<1149751368@qq.com>',  
        to: '670139644@qq.com',  
        subject: '你好',  
        html: '<h1>HTML代码</h1>',  
        text: '你好'  
    })  
    if (info.messageId) {  
        return {code: 0, msg: '发送成功'}  
    } else {  
        return {code: 1, msg: '发送失败', info}  
    }  
}